<div class="row">
	<div class="col-sm-12">
		<div>
    		<a href="/nursery/coursecate/add?per_page=<?php if(!empty($_REQUEST['per_page']))echo $_REQUEST['per_page']?>" class="btn btn-info_01 float_right btn_search">添加</a>
    	</div>
		<div class="space"></div>
		<table width="100%" class="table table-striped table-bordered table-hover">
			<tr>
			    <th height="30">ID</th>
				<th height="30">名称</th>
				<th height="30">图标</th>
				<th height="30">简介</th>
				<th height="30">销量</th>
				<th height="30">权重</th>
				<th height="30">创建时间</th>
				<th height="30">修改时间</th>
				<th height="30">操作</th>
			</tr>
			<?php if(!empty($course_cate_list)){foreach ($course_cate_list as $key=>$val){?>
			<tr>
			  <td height="30"><?php echo $val['id']?></td>
			  <td height="30"><?php echo $val['title'];?></td>
			  <td height="30"><img alt="" src="<?php echo $val['logo'];?>" width="50px"></td>
			  <td height="30"><?php echo $val['intro'];?></td>
			  <td height="30"><?php echo $val['sales'];?></td>
			  <td height="30">
			  <input type="text" name="weight" id="<?php echo $val['id'];?>" onchange="sort(this);" value="<?php echo $val['weight'];?>" style="width:50px">
			  </td>
			  <td height="30"><?php echo $val['create_date']?></td>
			  <td height="30"><?php echo $val['update_date']?></td>
			  <td height="30">
			  <a href='/nursery/coursecate/update?id=<?php echo $val['id']?>&per_page=<?php if(!empty($_REQUEST['per_page']))echo $_REQUEST['per_page']?>'>修改</a>
			   | <a href='/nursery/coursecate/delete?id=<?php echo $val['id']?>&status=1' onclick="if(confirm('确定要删除吗？')){return true;}else{return false;};">删除</a>			   </td>
		  </tr>
		  <?php }}else{?>
			<tr>
			  <td height="30" colspan="9"><div align="center"><?php echo $error;?></div></td>
		  </tr>
		  <?php }?>
	  </table>
		
		<div class="float_right">
			<?php echo $pagelink;?>
		</div>
	</div>
</div>
<script type="text/javascript">
function sort(obj){
	var id = $(obj).attr('id');
	var sort = $(obj).val();
	$.ajax({
	    type : "get", 
	    async:false, 
	    url : "/nursery/coursecate/sort?id="+id+'&sort='+sort, 
	    dataType : "json", 
	    success : function(data){
		    alert(data['msg']);
	    }, 
	    error:function(){
	        alert('fail'); 
	    } 
	});
}
</script>
<!--content-->